package com.rabbit.fanoutdemo.lstener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//需要被spring容器管理
@Component
/**
 * 接收方式一
 * 方式二放在了direct里面
 */
@RabbitListener(queues = {"fanout_queue_01","fanout_queue_02"})

public class FanoutListener01 {
    @RabbitHandler
    public void getMessage(String message){
        System.out.println(message);
    }
}
